package cn.ultrarisk.scadmin.manager.biz.solr.dto;

import java.io.Serializable;
import java.util.LinkedHashMap;
import java.util.Map;

/**
 * CollectionQuery
 *
 * @author sevendlong(lin23871@163.com)
 * @date 2014/6/6
 * @since V1.0
 */
public class CollectionQuery implements Serializable {
    private static final long serialVersionUID = -7067083977276657240L;

    private String q;
    private String fq;
    private String sort;
    private Integer start;
    private Integer row;
    private String fl;
    private String wt;
    private Boolean hl;
    private String hlFl;
    private String hlSimplePre;
    private String hlSimplePost;
    private Boolean spellCheck;
    private String spellCheckDirectory;
    private String spellCheckCount;
    private Boolean spellCheckOnlyMorePopular;
    private Boolean spellCheckCollate;
//    private Boolean spellCheckQ;
//    private Boolean spellCheckBuild;
//    private Boolean spellCheckReload;
//    private Boolean spellCheckExtendedResults;
//    private Boolean spellCheckMaxCollations;
//    private Boolean spellCheckMaxCollationTries;
//    private Boolean spellCheckAccuracy;

    public String getQ() {
        return q;
    }

    public void setQ(String q) {
        this.q = q;
    }

    public String getFq() {
        return fq;
    }

    public void setFq(String fq) {
        this.fq = fq;
    }

    public String getSort() {
        return sort;
    }

    public void setSort(String sort) {
        this.sort = sort;
    }

    public Integer getStart() {
        return start;
    }

    public void setStart(Integer start) {
        this.start = start;
    }

    public Integer getRow() {
        return row;
    }

    public void setRow(Integer row) {
        this.row = row;
    }

    public String getFl() {
        return fl;
    }

    public void setFl(String fl) {
        this.fl = fl;
    }

    public String getWt() {
        return wt;
    }

    public void setWt(String wt) {
        this.wt = wt;
    }

    public Boolean getHl() {
        return hl;
    }

    public void setHl(Boolean hl) {
        this.hl = hl;
    }

    public String getHlFl() {
        return hlFl;
    }

    public void setHlFl(String hlFl) {
        this.hlFl = hlFl;
    }

    public String getHlSimplePre() {
        return hlSimplePre;
    }

    public void setHlSimplePre(String hlSimplePre) {
        this.hlSimplePre = hlSimplePre;
    }

    public String getHlSimplePost() {
        return hlSimplePost;
    }

    public void setHlSimplePost(String hlSimplePost) {
        this.hlSimplePost = hlSimplePost;
    }

    public Boolean getSpellCheck() {
        return spellCheck;
    }

    public void setSpellCheck(Boolean spellCheck) {
        this.spellCheck = spellCheck;
    }

    public String getSpellCheckDirectory() {
        return spellCheckDirectory;
    }

    public void setSpellCheckDirectory(String spellCheckDirectory) {
        this.spellCheckDirectory = spellCheckDirectory;
    }

    public String getSpellCheckCount() {
        return spellCheckCount;
    }

    public void setSpellCheckCount(String spellCheckCount) {
        this.spellCheckCount = spellCheckCount;
    }

    public Boolean getSpellCheckOnlyMorePopular() {
        return spellCheckOnlyMorePopular;
    }

    public void setSpellCheckOnlyMorePopular(Boolean spellCheckOnlyMorePopular) {
        this.spellCheckOnlyMorePopular = spellCheckOnlyMorePopular;
    }

    public Boolean getSpellCheckCollate() {
        return spellCheckCollate;
    }

    public void setSpellCheckCollate(Boolean spellCheckCollate) {
        this.spellCheckCollate = spellCheckCollate;
    }

    public Map<String, Object> getParams() {
        Map<String, Object> querys = new LinkedHashMap<String, Object>();

        querys.put("q", q);
        querys.put("fq", fq);
        querys.put("sort", sort);
        querys.put("start", start);
        querys.put("rows", row);
        querys.put("fl", fl);
        querys.put("wt", wt);
        querys.put("hl", hl);
        querys.put("hl.fl", hlFl);
        querys.put("hl.simple.pre", hlSimplePre);
        querys.put("hl.simple.post", hlSimplePost);
        querys.put("spellcheck", spellCheck);
        querys.put("spellcheck.directory", spellCheckDirectory);
        querys.put("spellcheck.count", spellCheckCount);
        querys.put("spellcheck.onlyMorePopular", spellCheckOnlyMorePopular);
        querys.put("spellcheck.collate", spellCheckCollate);
        querys.put("indent", true);
//        querys.put("spellcheck.build", spellCheckBuild);
//        querys.put("spellcheck.reload", spellCheckReload);
//        querys.put("spellcheck.q", spellCheckQ);
//        querys.put("spellcheck.extendedResults", spellCheckExtendedResults);
//        querys.put("spellcheck.maxCollations", spellCheckMaxCollations);
//        querys.put("spellcheck.maxCollationTries", spellCheckMaxCollationTries);
//        querys.put("spellcheck.accuracy", spellCheckAccuracy);

        return querys;
    }
}
